package top.zuli.package01.class06;

public class User4 {
    int id;
    String name;
    int age;
    //定义构造方法
    User4(int User4Id,String User4Name,int User4Age){
        id = User4Id;
        name = User4Name;
        age = User4Age;
    }
    //构造方法的重载
    User4(int User4Id,String User4Name){
        id = User4Id;
        name = User4Name;
    }
    User4(){

    }

    public static void main(String[] args) {
        //使用构造方法创建对象
        User4 User4 = new User4(1,"张三",21);
        //查看User4信息
        System.out.println("id:"+User4.id+",name:"+User4.name+",age:"+User4.age);

        //创建对象，查看用户信息
        User4 User42 = new User4(2,"李四");
        System.out.println("id:"+User42.id+",name:"+User42.name+",age:"+User42.age);

        //创建对象，查看用户信息
        User4 User43 = new User4();
        System.out.println("id:"+User43.id+",name:"+User43.name+",age:"+User43.age);
    }
}
